Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pre-commit to manage code style & repo QA #121

Merged
merged 3 commits into from
Jan 4, 2025
Merged

Conversation

douglatornell
Copy link
Member

pre-commit hooks:

  • Code formatting by black
  • Trim trailing whitespace
  • Ensure that files are either empty, or end with one newline
  • Confirm that YAML files have parsable syntax
  • Confirm that TOML files have parsable syntax
  • Prevent files larger than 500 kB from being committed

Also lots of code cleanup.

Introduced `.pre-commit-config.yaml` to configure pre-commit hooks,
including Black for code formatting and other QA checks. Updated
dependencies and environments to include `pre-commit` and `black` for
consistent coding standards.

pre-commit hooks:
* Code formatting by black
* Trim trailing whitespace
* Ensure that files are either empty, or end with one newline
* Confirm that YAML files have parsable syntax
* Confirm that TOML files have parsable syntax
* Prevent files larger than 500 kB from being committed
Code style gardening by the pre-commit hooks, especially black.
Also fix CRLF line endings.
WARNING: This module has many other broken code issues in it. Much debugging
and modernization will be required if you want to use it.
@douglatornell douglatornell added SalishSeaTools maintenance Codebase & repo maintenance labels Jan 4, 2025
@douglatornell douglatornell added this to the v24.1 milestone Jan 4, 2025
Copy link

codecov bot commented Jan 4, 2025

Codecov Report

Attention: Patch coverage is 24.43609% with 201 lines in your changes missing coverage. Please review.

Project coverage is 53.32%. Comparing base (ad92639) to head (391d736).

Files with missing lines Patch % Lines
SalishSeaTools/salishsea_tools/nc_tools.py 25.40% 91 Missing ⚠️
SalishSeaTools/salishsea_tools/places.py 3.17% 61 Missing ⚠️
SalishSeaTools/salishsea_tools/bathy_tools.py 4.00% 24 Missing ⚠️
SalishSeaTools/salishsea_tools/geo_tools.py 32.35% 23 Missing ⚠️
SalishSeaTools/salishsea_tools/hg_commands.py 90.90% 1 Missing ⚠️
SalishSeaTools/salishsea_tools/namelist.py 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #121      +/-   ##
==========================================
- Coverage   53.35%   53.32%   -0.04%     
==========================================
  Files          29       29              
  Lines        3522     3524       +2     
==========================================
  Hits         1879     1879              
- Misses       1643     1645       +2     
Flag Coverage Δ
unittests 53.32% <24.43%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@douglatornell douglatornell merged commit 44b3bad into main Jan 4, 2025
6 of 8 checks passed
@douglatornell douglatornell deleted the add-pre-commit branch January 4, 2025 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Codebase & repo maintenance SalishSeaTools
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant